/* 学生模块 */
import {doPost, doFormDate} from '../../utils/request'

/**
 * 获取验证码
 * */
function getCode ({params, callback}) {
  doPost({
    url: '/admin/Send/sendmsg',
    params,
    success: res => {
      callback(res)
    }
  })
}

/**
 * 登录
 * */
function studentLogin ({params, callback}) {
  doPost({
    url: '/admin/login/login',
    params,
    success: res => {
      callback(res)
    }
  })
}

/**
 * 获取用户信息
 * */
function getUserInfo ({params, callback}) {
  doPost({
    url: '/admin/user/personal',
    params,
    success: res => {
      callback(res)
    }
  })
}

/**
 * 完善个人信息（学生）
 */
function perfectInfo ({params, callback}) {
  doFormDate({
    url: '/admin/user/perfect_individual',
    params,
    success: res => {
      callback(res)
    }
  })
}

/**
* 获取消息
* */
function getMessage ({params, callback}) {
  doPost({
    url: '/admin/user/message_management',
    params,
    success: res => {
      callback(res)
    }
  })
}

/**
 * 消息首页
 * */
function getMessageIndex ({params, callback}) {
  doPost({
    url: '/admin/user/message_index',
    params,
    success: res => {
      callback(res)
    }
  })
}

/**
 * 添加荣誉
 * */
function addHonor ({params, callback}) {
  doFormDate({
    url: '/admin/user/message_honor',
    params,
    success: res => {
      callback(res)
    }
  })
}

/**
 * 荣誉列表
 * */
function honorList ({params, callback}) {
  doPost({
    url: '/admin/user/list_honor',
    params,
    success: res => {
      callback(res)
    }
  })
}

/**
 * 删除荣誉
 * */
function deleteHonor ({params, callback}) {
  doPost({
    url: '/admin/user/honor_delect',
    params,
    success: res => {
      callback(res)
    }
  })
}

/**
 * 学生打卡
 * */
function studentCheck ({params, callback}) {
  doPost({
    url: '/admin/Curriculum/clock_in',
    params,
    success: res => {
      callback(res)
    }
  })
}

/**
 * 打卡列表
 * */
function getStudentCheckIn ({params, callback}) {
  doPost({
    url: '/admin/Curriculum/clock_list',
    params,
    success: res => {
      callback(res)
    }
  })
}

/**
 * 学生请假
 * */
function studentLeave ({params, callback}) {
  doPost({
    url: '/admin/user/leave',
    params,
    success: res => {
      callback(res)
    }
  })
}

// 课程表
function studentCourse ({params, callback}) {
  doPost({
    url: '/admin/curriculum/curriculum_list',
    params,
    success: res => {
      callback(res)
    }
  })
}

// 单节课程详情
function studentCourseDetail ({params, callback}) {
  doPost({
    url: '/admin/curriculum/curriculum_find',
    params,
    success: res => {
      callback(res)
    }
  })
}

// 签到
function studentCheckIndex ({params, callback}) {
  doPost({
    url: '/admin/curriculum/curriculum_register',
    params,
    success: res => {
      callback(res)
    }
  })
}

function studentCheckMy ({params, callback}) {
  doPost({
    url: '/admin/curriculum/register_new',
    params,
    success: res => {
      callback(res)
    }
  })
}

// 首页签到课程列表
function studentCourseMy ({params, callback}) {
  doPost({
    url: '/admin/curriculum/curriculum',
    params,
    success: res => {
      callback(res)
    }
  })
}

// 首页分享教师课程
function studentTeacherMy ({params, callback}) {
  doPost({
    url: '/admin/curriculum/curriculum_teacher',
    params,
    success: res => {
      callback(res)
    }
  })
}

// 获取分享模板
function studentPosterTemp ({params, callback}) {
  doPost({
    url: '/admin/curriculum/curriculum_teacherposter',
    params,
    success: res => {
      callback(res)
    }
  })
}

// 课程报告
function studentAssess ({params, callback}) {
  doPost({
    url: '/admin/Curriculum/curriculum_evaluate',
    params,
    success: res => {
      callback(res)
    }
  })
}

export default {
  perfectInfo,
  getMessage,
  addHonor,
  getMessageIndex,
  getCode,
  studentLogin,
  getUserInfo,
  honorList,
  deleteHonor,
  studentCheck,
  getStudentCheckIn,
  studentLeave,
  studentCourse,
  studentCourseDetail,
  studentCheckIndex,
  studentCheckMy,
  studentCourseMy,
  studentTeacherMy,
  studentPosterTemp,
  studentAssess
}
